home *** CD-ROM | disk | FTP | other *** search
- Path: news.nbnet.nb.ca!news
- From: rwb2@mtt.ca (Rick Bruce)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: sizeof() question >>> :)
- Date: 16 Apr 1996 15:12:27 GMT
- Organization: NBNet
- Message-ID: <4l0dcr$14t0@darwin.nbnet.nb.ca>
- References: <1996Apr12.061927@topaz> <31714828.1574068@news.linex.com>
- Reply-To: rwb2@mtt.ca (Rick Bruce)
- NNTP-Posting-Host: guardian.mtt.ca
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <31714828.1574068@news.linex.com>, mfried@linex.com (Marty Fried) writes:
- >Once upon a time (OK, it was 12 Apr 96 06:19:27 +1000),
- >naderr@topaz.cqu.edu.au wrote:
- >
- >>Hi,
- >>
- >>How can I get, with a pointer, the sizeof of an array that is
- >>pointed by the pointer ? (No it's not a tounge twister :)
- >>
- >> while (!done) {
- >> ch = getchar();
- >> if (cp - *ct < sizeof(XXXXXXX)-1) {
- >> *cp++ = ch;
- >> } else {
- >> beep();
- >> }
- >> }
- >
- > If you allocate the space for the array you can call one of the memory
- > routines which return the size of the allocation.
- > Dave Gaudet via Rick Bruce
-
-